#ifndef PROJECTEXPLORER_H
#define PROJECTEXPLORER_H

#include <QWidget>
#include <QModelIndex>

namespace sk
{
    class GameItem;
}

namespace Ui {
    class ProjectExplorer;
}
class QAbstractItemModel;
class QAbstractItemDelegate;

class ProjectExplorer : public QWidget
{
    Q_OBJECT

    friend class MainWindow;
public:
    explicit ProjectExplorer(QWidget *parent = 0);
    ~ProjectExplorer();

    void setModel(QAbstractItemModel * model);
    void setItemDelegate(QAbstractItemDelegate * delegate);
    void updateProperty(QString name);
    void loadProperties(sk::GameItem * item);
    void select(sk::GameItem * item);
    void activate(sk::GameItem * item);
private:
    Ui::ProjectExplorer *ui;

private slots:
    void on_btnClone_clicked();
    void on_btnDown_clicked();
    void on_btnUp_clicked();
    void on_btnDelete_clicked();
    void on_projectView_clicked(QModelIndex index);
    void on_projectView_doubleClicked(QModelIndex index);
    void on_btnNew_clicked();

private:
    void _clearProperties();

    sk::GameItem * _propertyItem;
};

#endif // PROJECTEXPLORER_H
